/*
* Copyright 2010 Dovado FZ-LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import <UIKit/UIKit.h>

/*
 * Listener interface that is used to give callback for network requests that has been done 
 * via DovadosNetworkRequest. 
 *
 */
@protocol DovadoRequestListener

typedef enum error_codes {
	ERROR_UNKNOWN_USER = 0,
	ERROR_ANOTHER_ACTIVE_API,
	ERROR_UNKNOWN_ERROR,
	ERROR_UNABLE_TO_CLOSE_CONNECTION
} request_listener_error_t;

@optional

/*
 * Callback method that returns a list of the available alias from the router. 
 *
 * @param 
 *		aliasArray a array with Alias object
 */
- (void) aliasRequestDone: (NSMutableArray*) aliasArray;

/*
 * Callback method that returns a list of the available groups from the router. 
 *
 * @param 
 *		groupsArray a array with Groups object
 */

- (void) groupsRequestDone: (NSMutableArray*) groupsArray;

/*
 * Callback method that returns a list of the available groups and alias from the router. 
 *
 * @param 
 *		groupsArray a array with Groups object
 * @param 
 *		aliasArray a array with Alias object
 */
- (void) groupsAndAliasRequestDone: (NSMutableArray*) groupsArray: (NSMutableArray*) aliasArray;

/*
 * Callback method that returns a list of the available groups, alias and router info from the router. 
 *
 * @param 
 *		groupsArray a array with Groups object
 * @param 
 *		aliasArray a array with Alias object
 * @param 
 *		infoArray a array with Info object
 */
- (void) syncAllRequestDone: (NSMutableArray*) groupsArray: (NSMutableArray*) aliasArray: (NSMutableArray*) infoArray;

/*
 * Callback method that returns a list of the available router information from the router. 
 *
 * @param 
 *		infoArray a array with Info object
 */
- (void) infoRequestDone: (NSMutableArray*) infoArray;

/*
 * Callback method that is called when a on/off request has finished. 
 */
- (void) onoffRequestDone;

/*
 * Callback method that is called when dimmer request has finished. 
 */
- (void) dimRequestDone;

@required
/*
 * Callback method that is called when a network request has failed. 
 *
 * @param
 *		error_code the error code type
 * @param
 *		message the server message string if any exist or "" if no message. 
 */
- (void) dovadoRequestFailed: (request_listener_error_t) error_code: (NSString*) message;

@end
